<?php /* Smarty version Smarty-3.1.18, created on 2017-05-17 08:17:46
         compiled from "/data/www/mystery/protected/modules/webadmin/views/project/list.tpl" */ ?>
<?php /*%%SmartyHeaderCode:85311366754bfaf309c3647-03047136%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '90bfab0e04d12d170501975f48aaa8cba5816c3f' => 
    array (
      0 => '/data/www/mystery/protected/modules/webadmin/views/project/list.tpl',
      1 => 1494904923,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '85311366754bfaf309c3647-03047136',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.18',
  'unifunc' => 'content_54bfaf30a2ae66_99568166',
  'variables' => 
  array (
    'project_name' => 0,
    'status' => 0,
    'key' => 0,
    'current_status' => 0,
    'val' => 0,
    'list' => 0,
    'page' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_54bfaf30a2ae66_99568166')) {function content_54bfaf30a2ae66_99568166($_smarty_tpl) {?><?php if (!is_callable('smarty_modifier_date_format')) include '/data/www/mystery/protected/extensions/Smarty/plugins/modifier.date_format.php';
?><?php echo $_smarty_tpl->getSubTemplate ("../common/header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<table width="100%" border="0" cellspacing="0">
 <tr>
    <td width="13%" valign="top">
            <?php echo $_smarty_tpl->getSubTemplate ("../common/left.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

    </td>
    <td width="87%" valign="top">
					
        <table width="100%" border="0" cellspacing="0">
          <tr>
                <td>
                    <div class="subnav">
                    <form name="form1" id="form1" method="get" action="/webadmin/project/list">
                    <div class="explain-col">
                           项目名称：<input type="text" value="<?php echo $_smarty_tpl->tpl_vars['project_name']->value;?>
" class="input-text" name="project_name">
                           状态：<select name="current_status" autocomplete="off">
                               <option value="0">所有</option>
                               <?php  $_smarty_tpl->tpl_vars['val'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['val']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['status']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['val']->key => $_smarty_tpl->tpl_vars['val']->value) {
$_smarty_tpl->tpl_vars['val']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['val']->key;
?>
                               <?php if ($_smarty_tpl->tpl_vars['key']->value!=0) {?><option value="<?php echo $_smarty_tpl->tpl_vars['key']->value;?>
" <?php if ($_smarty_tpl->tpl_vars['current_status']->value==$_smarty_tpl->tpl_vars['key']->value) {?>selected="selected"<?php }?>><?php echo $_smarty_tpl->tpl_vars['val']->value;?>
</option><?php }?>
                               <?php } ?>
                           </select>
                                           <input type="submit" value="搜索" class="button" name="dosubmit"> 
                    </div>
                    </form>
                      <div class="content-menu ib-a blue line-x"> 
                      <a href="javascript:;" class="on"><em>项目信息管理</em></a><span>|</span>
                      <a href="/webadmin/project/add"><em>添加项目</em></a>
                      </div>
                    </div>

                        <div class="pad_10">
                          <div class="table-list">
                          <table width="100%">
                                <thead>
                                  <tr>
                                        <th width="96">项目编号</th>
                                        <th width="517" align="left">项目名称</th>
                                        <th width="82">问卷数量</th>
                                        <th width="150">更新时间</th>
                                        <th width="40">状态</th>
                                        <th width="200">管理操作</th>
                                  </tr>
                                </thead>
                                <tbody>
                                  <?php  $_smarty_tpl->tpl_vars['val'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['val']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['list']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['val']->key => $_smarty_tpl->tpl_vars['val']->value) {
$_smarty_tpl->tpl_vars['val']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['val']->key;
?>
                                  <tr id="project_<?php echo $_smarty_tpl->tpl_vars['val']->value['project_id'];?>
">
                                        <td align="center"><?php echo $_smarty_tpl->tpl_vars['val']->value['project_num'];?>
</td>
                                        <td align="left">
                                                <a href="/webadmin/question/list?project_id=<?php echo $_smarty_tpl->tpl_vars['val']->value['project_id'];?>
"> <span style=""><?php echo $_smarty_tpl->tpl_vars['val']->value['project_name'];?>
</span></a> 
                                        </td>
                                        <td align="center"><?php if ($_smarty_tpl->tpl_vars['val']->value['question_num']) {?><?php echo $_smarty_tpl->tpl_vars['val']->value['question_num'];?>
<?php } else { ?>0<?php }?></td>
                                        <td align="center"><?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['val']->value['update_time'],"%Y-%m-%d %H:%M:%S");?>
</td>
                                        <td><?php echo $_smarty_tpl->tpl_vars['status']->value[$_smarty_tpl->tpl_vars['val']->value['status']];?>
</td>
                                        <td align="center">
                                            <a href="/webadmin/project/view?project_id=<?php echo $_smarty_tpl->tpl_vars['val']->value['project_id'];?>
">预览</a> | 
                                            <a href="/webadmin/question/add?project_id=<?php echo $_smarty_tpl->tpl_vars['val']->value['project_id'];?>
">添加新问卷</a> | 
                                            <a href="/webadmin/project/edit?project_id=<?php echo $_smarty_tpl->tpl_vars['val']->value['project_id'];?>
">修改</a> | 
                                            <a href="javascript:;" name="delete" rel="<?php echo $_smarty_tpl->tpl_vars['val']->value['project_id'];?>
">删除</a>
                                        </td>
                                  </tr>
                                  <?php } ?>
                                </tbody>
                          </table>
                                <div style="float:right;"><?php echo $_smarty_tpl->tpl_vars['page']->value;?>
</div>
                          </div>
                        </div>
                </td>
          </tr>
        </table>
    	</td>
 </tr>
</table>
<script type="text/javascript">
$(document).ready(function($) {
	$('a[name="delete"]').click(function() {
		var id = $(this).attr('rel');
		if (id == ''){
			return false;
		}
		$or = confirm('你确定要删除吗？');
		if($or){
	  		$.ajax({
	 			 type:'post',
	 			 async : true,
				 dataType:"json",
				 data: {'project_id':id},
	 			 url:'/webadmin/project/delete',
	 			 success:function(data){
	 				if(data.status==1){
                                            $('#project_'+id).remove();
					}
                                        alert(data.note);
	 			 }
	 		});
	  	}
	});
});
</script>
<?php echo $_smarty_tpl->getSubTemplate ("../common/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
<?php }} ?>
